package com.chenjiaru.thread.startthread;

import lombok.extern.slf4j.Slf4j;

/**
 * 创建线程方式一：继承Thread类，其实Thread实现了Runnable接口的
 */
@Slf4j
public class ThreadDemo {
    public static void main(String[] arr) {
        new MyThread().start();
        log.warn("程序结束");
    }
}


@Slf4j
class MyThread extends Thread {
    @Override
    public void run() {
        for (int i = 0; i < 1000; i++) {
            log.info("{}", i);
        }
        log.info("线程结束");
    }
}
